home *** CD-ROM | disk | FTP | other *** search
- GET -- Bob Stephan's Batch file enhancer -- a public domain utility
- Syntax: GET command argument
- Purpose Command Argument Environment Errorlevel Extended
- --------- ------- -------- --(GET=)--- --(Exit)-- --[E]---
- Get character C[E] ["prompt"] [chars] Character ASCII dec. No Echo
- Get yes/no aNswer N[E] ["prompt"] None Character ASCII dec. No Echo
- Get string S[E] ["prompt"] None String Length No Echo
- Moving Text(GetaKey)T[E] "Filespec" [chars] Character ASCII dec. No Echo
- Get DOS version D[E] None Major Vers. MajorMinor MinorEnv
- Get environment left E[E] None Bytes left Bytes left Bytes/10
- Get file size (DIR=0) F[E] Filespec Hex bytes Kilobytes Kb/10
- Get disk space K[E] [driveletter] Kilobytes Kilobytes Kb/10
- Get memory free M[E] None Kilobytes Kilobytes Kb/10
- Clear (Blank) Screen B[E] [New attribute] Current or last attr. HexAttr
- Check for printer P None 1=yes,0=no 1=yes,0=no None
- Get/set video mode V [New mode] Current or last mode None
- Check coprocessor 7 None 1=yes,0=no 1=yes,0=no None
- Check for ANSI.SYS A None 1=yes,0=no 1=yes,0=no None
- Get current directory Y[E] None Directory Level/Drive Drive
- Surrogate [char] args: } is Carriage Return, ~ is Escape, ` is Extended.
-
- Explanations:
- To display the above screen, enter GET with no arguments, or GET ?.
- Commands are single characters or a character and [optionally] E with
- no spaces between. The E indicates the Extended function above.
- N, the yes/no aNswer will accept y, n, carriage return, or Esc.
- B, the screen Blanker, does not change your color settings unless
- you give it an attribute to use, and it will work with any number
- of lines on the screen (e.g. EGA 43 or VGA 50). If an attribute
- argument is given it is taken to be a 1, 2, or 3-digit decimal number
- that is converted to a two-digit hexadecimal number for the attribute.
- The extended function BE regards an argument as a 1 or 2-digit hex
- number, and the GET value in the environment is in hex.
- A table of screen attributes will be useful.
- [] brackets indicate optional portions of commands and/or arguments. The
- command will work regardless whether these portions are included or not.
- The brackets themselves must not be included!
- " Where double quotes ("'s) are shown, they must be included if the
- corresponding command or argument is used.
- Filespec's may include drive and path but no wild cards.
- [chars] are optional characters that limit the user input to just
- the characters given. This should be a contiguous character
- string separated from the prompt, if given, by a space.
- Single keystrokes for C, N or T are acted on without pressing Enter.
- (String input, of course, will require the user to press Enter.)
- The comparison of characters is not case sensitive. To
- indicate that a carriage return, Esc, or Extended key is
- acceptable, include the surrogate character listed above. CR and
- Esc will return 125 and 126 in the errorlevel respectively. If
- no chars are given, any key stroke will be accepted. If extended
- keyboard characters are specified, the scan code will be in the
- errorlevel and the corresponding ASCII byte in the environment
- preceeded by "`". A table of keyboard scan codes will be useful.
- Environment: this column indicates what will be found in the
- environment string GET=. This string can be accessed from a
- BATch file with the %GET% notation.
- Errorlevel: this column indicates what value will be placed in the
- DOS errorlevel that can be accessed in BATch files with the
- "if errorlevel" subcommand.
- Extended: this column indicates the action taken if the optional
- [E]xtended command is included. Do not include the brackets!
- For example, to get the drive use GET YE. The values/10 refer to
- errorlevel return codes reduced by a factor of 10, useful for large
- values. The drive for the Y command will be in both places using
- 0 for A:, 1 for B:, etc. in the errorlevel. For the D command,
- the minor DOS version (e.g., the 1 in 3.1) will be in the environment,
- but the errorlevel will have (major*10)+minor in either case (e.g. 31).
- T, the Moving Text feature, requires a file with the prompt string that
- will be displayed moving across the bottom line of the screen.
- Currently only standard 25 line screens are supported. The text
- file should be plain ASCII without any control characters (No CR,
- LF, or any other characters below ASCII 32). To be effective
- the prompt must be over 80 characters long, and to ensure
- smooth wrap-around the first 79 characters should be repeated
- at the end. The maximum length for the text of the moving
- prompt is 4096 characters. Over that it will be truncated.
- V: don't fool around with Video mode unless you know what you're doing!
-
- GET is programmmed in assembly language for MS-DOS computers. If you need
- more BATch programming capability than is included here, I suggest you look
- into the Shareware product, Extended Batch Language (EBL). However, you
- will probably have to pay a licensing fee for EBL, and GET is FREE!
- Much of the code for GET was adapted from the sample program named
- WHAT.ASM included with Microsoft Macro Assembler (MASM). The MASM
- documentation declares that the sample programs are in the public domain.
- For examples of GET, look at the BATch files on the MASDIR disk for
- the use of a similar program called SDL_GET. You can do a lot in
- BATch programming with this utility. It remains in the public domain
- for all to enjoy. /s/Bob Stephan June 18, 1989
-
- If you have any questions, comments, or suggestions please contact me at:
- MOBY DISK: 1021 San Carlos Road, Pebble Beach, CA 93953
- Phone: (408) 646-1899, 646-1373. GENIE:MOBYDISK. COMPUSERVE:72357,2276
-
- Now for the commercial: If you like GET you will love MASDIR!
- MASDIR (pronounced 'master') the MASter DIRectory System, is a general
- purpose sorted directory program with unique disk label printing and
- customization features. If you ever use DIR, you should do yourself a
- favor and take a look at MASDIR. The main program, SDL.COM, is one of the
- best sorted directory programs anywhere. The setup program allows you to
- set the many defaults to your own specifications, including customizing
- the titles that appear in the header. In addition, you can print disk
- labels and or sleeve inserts for 5.25" and 3.5" diskettes. This really
- saves you a lot of time when you are looking through your collection of
- diskettes for a particular file. They are all listed conveniently along
- with your own description in the title lines. You can also create disk
- file catalogs of your diskettes and directories that you can then
- annotate to describe individual files.
-
- As of the above date, the current release of MASDIR is Version 4.3. It is
- a shareware program that is available on bulletin boards, GENIE,
- CompuServe, The Public (software) Library, and from other distributors of
- public domain and shareware programs. If you cannot conveniently locate a
- copy, I will be happy to send you one. Just contact me as indicated
- above. Thank you for your kind attention. /Bob/
-